﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/static/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>托单处理</title>
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<link rel="stylesheet" href="static/ace/css/bootstrap.css" />
		<link rel="stylesheet" href="static/ace/css/font-awesome.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="static/ace/css/ace-fonts.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="static/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />
		<link rel="stylesheet" type="text/css" href="plugins/websocketInstantMsg/ext4/resources/css/ext-all.css">
		<script type="text/javascript" src="plugins/websocketInstantMsg/ext4/ext-all-debug.js"></script>
<!-- 		<script type="text/javascript" src="static/js/consignhandle/cost.js?t=5"></script> -->
<!-- 		<script type="text/javascript" src="static/js/consignhandle/costout.js?t=5"></script> -->

	</head>
		 
<body class="no-skin">
	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">
		<div id="selForm"></div>
		<div id="output"></div>
<!-- 		<div> -->
			
<!-- 		</div> -->
	</div>
</body>

	<script type="text/javascript">

		Ext.onReady(function () {
// 			var store = Ext.create('Ext.data.Store', {
// 				fields: ["ID","PRICE_STOP_TIME","DESTINATION_COUNTRY","PRICE_START_TIME","TERRITORY_GOODS_SUPPLY","billCode","ladingBillCode","loadingGoingShips","bookingStatus","estimateTime","mscBillCode",
// 					"EMPTY_WEIGHT_BOX","shipperName","bookingClerk","containerOwner","boxTypeConfirm","appointEstimateShipTime",
// 					"appointShipRoute","bookingShippingRoutes","bookingSeagoingVessels","goodsType",
// 					"goodsNum","unit","goodsGrossWeight","","volume","tradeType","createTime","salerName",
// 					"forwarderCustomerService","transportClause","customsNum","tradeMethod","chineseName",
// 					"riverPort","bookingDischargingPort","bookingPlaceDelivery","riverUnload","riverDelivery",
// 					"estimateRiverBoatTime","bookingOperationNotes","shippingMark","sailingTimes","cusModId","cusBroId","commodityInspectionNum","BILL_TYPE","agencyInsurance","isFumigation",
// 					"insuranceName","insuranceAmount","insuranceRate","insuranceRemark","encasementMethod","factoryContainerTypeNum","portContainerTypeNum","loadContainerTime","appointPutContainerTime",
// 					"portSplitRequirements","goodsNum","goodsUnit","goodsGrossWeight","volume","isArrangeTrailer","businessTypeId","SETTLE_UNIT","RIVER_LOAD","TRANSPORT_CLAUSE"],
// 				pageSize: 25,  //页容量5条数据
// 				//是否在服务端排序 （true的话，在客户端就不能排序）
// 				remoteSort: false,
// 				remoteFilter: true,
// 				proxy: {
// 					type: 'ajax',
// 					url: '../consignHandle/list',
// 					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
// 						type: 'json', //返回数据类型为json格式
// 						root: 'result.list',  //数据
// 						totalProperty: 'result.total' //数据总条数
// 					}
// 				},
// 				sorters: [{
// 					property: 'ordeId',
// 					direction: 'desc'
// 				}],
// 				autoLoad: true
// 			});
var store = Ext.create('Ext.data.Store', {
				fields: ["ID","billCode","ladingBillCode","consignorName","IS_MAIN_LADING_BILL","SHIPPER_NUM","BUSINESS_TYPE",
				         "BILL_FLOW","BOAT_COMPANY_BOOK_PRICE","BOAT_VOYAGE_NAME","PRICE_START_TIME","PRICE_STOP_TIME",
				         "APPOINT_ESTIMATE_SHIP_TIME","BILL_TYPE","INVOICE_NUM","SUB_SUPPLIER","RESERVE_MATCH_BOX_OWNER",
				         "GOODS_TYPE","BOX_TYPE_CONFIRM","TWENTY_GP","FORTY_GP","FORTY","FORTY_FIVE",
				         "SPECIAL_CONTAINER","TEU","CUS_MOD","CUS_BRO","RIVER_LOAD","RIVER_UNLOAD","SEA_LOAD",
				         "PORT","END_PORT","RIVER_DELIVERY","BOAT_NAME","BOAT_VOYAGE_NAME","BOAT_ETD","BOAT_ETA",
				         "BOAT_ATD","SHIP_NAME","SHIP_VOYAGE_NAME","SHIP_ATD","SHIP_ATA","SALER_NAME","ENTRUST_TIME",
				         "ISSET_ABOUT","IS_FEE_FINISH","MSC_LADING_BILL","FREIGHT_EXAMINE","BOOKING_CARGO_ACCEPTANCE",
				         "SHIP_COMPANY_PUT_BOX","WHARF_PUT_BOX","CUSTOMER_PUT_BOX","TRAILER_PLAN","TRAILER_FINISH",
				         "INSURANCE_APPLY_BILL","HARBOUR_PRETEND_BOX","PRETEND_BOX_FINISH","CUSTOMS_PLAN","CUSTOMS_FINISH",
				         "FUMIGATION_FINISH","APPLY_MATCH","BOAT_MATCH","TRANSPORT_SUCCESS","PRETEND_BOX_DATA_SUBMIT","VGM_CONFIRM",
				         "LADING_BILL_CONFIRM","LADING_BILL_ISSUE","SHIP_PRE_MATCH","SEAL_PRE_MATCH","PRE_MATCH_CABIN_BILL",
				         "TRANSFER_CUSTOMS","IS_TO_PORT","SHIP_WITH","SEAL_ACCOUNT","APPLY_BILLING","TERRITORY_GOODS_SUPPLY",
				         "PRICE_START_TIME","PRICE_STOP_TIME","DESTINATION_COUNTRY","appointShipRoute","riverUnload","riverDelivery",
				         "businessTypeId","transportClause","EMPTY_WEIGHT_BOX","boxTypeConfirm"],
				pageSize: 25,  //页容量5条数据
				//是否在服务端排序 （true的话，在客户端就不能排序）
				remoteSort: false,
				remoteFilter: true,
				proxy: {
					type: 'ajax',
					url: '../consignHandle/list',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						root: 'result.list',  //数据
						totalProperty: 'result.total' //数据总条数
					}
				},
				sorters: [{
					property: 'ordeId',
					direction: 'desc'
				}],
				autoLoad: true
			});
			var store1 = Ext.create('Ext.data.Store', {
				fields: ["ID","BILL_CODE","TRAILER_TYPE","PACKING_TYPE","REMARK","RETCONTAINERADDR","TRAILER_ADDR","TRAILER_DATE","TRAILER_PRICE","CONTACT_PERSON","CONTACT_INFO",
					"TRAILER_FINISH"],
				pageSize: 30,  //页容量5条数据
				//是否在服务端排序 （true的话，在客户端就不能排序）
				remoteSort: false,
				remoteFilter: true,
				proxy: {
					type: 'ajax',
					url: '../consignHandle/findTrailerByBillCode',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						root: 'result.list',  //数据
						totalProperty: 'result.total' //数据总条数
					}
				},
// 				sorters: [{
// 					property: 'ordeId',
// 					direction: 'desc'
// 				}],
// 				autoLoad: true
			});
			var customsMode = Ext.create('Ext.data.Store', {
				fields: ["CUSTOMS_DECLARATION_MODE","ID"],
				pageSize: 30,  //页容量5条数据
				//是否在服务端排序 （true的话，在客户端就不能排序）
				remoteSort: false,
				remoteFilter: true,
				proxy: {
					type: 'ajax',
					url: '../consignHandle/findCustomsMode',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						root: 'customsMode',  //数据
						//totalProperty: 'result.total' //数据总条数
					}
				},
				sorters: [{
					property: 'ordeId',
					direction: 'desc'
				}],
				autoLoad: true
			});
			var customs = Ext.create('Ext.data.Store', {
				fields: ["CUSTOMS_BROKER_NAME","ID"],
				pageSize: 30,  //页容量5条数据
				//是否在服务端排序 （true的话，在客户端就不能排序）
				remoteSort: false,
				remoteFilter: true,
				proxy: {
					type: 'ajax',
					url: '../consignHandle/findCustoms',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						root: 'customs',  //数据
						//totalProperty: 'result.total' //数据总条数
					}
				},
				sorters: [{
					property: 'ordeId',
					direction: 'desc'
				}],
				autoLoad: true
			});
			var billType = Ext.create('Ext.data.Store', {
				fields: ["LADING_BILL_TYPE","ID"],
				pageSize: 30,  //页容量5条数据
				//是否在服务端排序 （true的话，在客户端就不能排序）
				remoteSort: false,
				remoteFilter: true,
				proxy: {
					type: 'ajax',
					url: '../consignHandle/findBillType',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						root: 'billType',  //数据
						//totalProperty: 'result.total' //数据总条数
					}
				},
				sorters: [{
					property: 'ordeId',
					direction: 'desc'
				}],
				autoLoad: true
			});
			var riverShipStore = Ext.create('Ext.data.Store', {
// 				type: 'ajax',
				  
				fields: ['SHIP_NAME_ID', 'SHIP_NAME','VOYAGE_NUMBER','SCHEDULED_SAILING_TIME'],
				proxy: {
					type: 'ajax',
					url : '../consignHandle/findRiverShipCompany',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						root: 'tt',  //数据
					}
				},

				autoLoad: true

			});
			//结算单位下拉
		     var Clearingunit = Ext.create('Ext.data.Store', {
			        fields: ["ID","ENTITIES_FULLNAME"],
			        remoteSort: false,
			        remoteFilter: true,
			        proxy: {
			            type: 'ajax',
			            url: '../consignHandle/findjiesuan ',
			            reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
			                type: 'json', //返回数据类型为json格式
			                root: 'rows520',  //数据
			                totalProperty: 'tota520' //数据总条数
			            }
			        },
			      
			        autoLoad: true  //即时加载数据
			    });
			
		
			riverShipStore.reload();
			var insuranceStore = Ext.create('Ext.data.Store', {
				fields: ['id', 'name'],
				data : [
					{"id":"", "name":"请选择"},
					{"id":"1", "name":"是"},
					{"id":"0", "name":"否"}
				]
			});
			var trailerStore = Ext.create('Ext.data.Store', {
				fields: ['id', 'name'],
				data : [
					{"id":"", "name":"请选择"},
					{"id":"1", "name":"自拖车"},
					{"id":"0", "name":"委托拖车"}
				]
			});
			var trailerType = Ext.create('Ext.data.Store', {
				fields: ['id', 'name'],
				data : [
					{"id":"", "name":"请选择"},
					{"id":"1", "name":"起运港拖车"},
					{"id":"0", "name":"目的港拖车"}
				]
			});
			
			var boxType = Ext.create('Ext.data.Store', {
				fields: ['id', 'name'],
				data : [
					{"id":"", "name":"请选择"},
					{"id":"1", "name":"拆箱"},
					{"id":"0", "name":"装箱"}
				]
			});
			var tbtn1 = Ext.create("Ext.Button",{
				text:'托单修改',
				icon: '../plugins/websocketInstantMsg/ext4/shared/icons/fam/cog_edit.png',
				handler:function(){
					 var records = grid.getSelectionModel().getSelection();
		   	         if(records.length==0){
		     			Ext.Msg.alert("提示","请选择一条记录");return;
		     		 }
		     		 if(records.length>1){
		     			Ext.Msg.alert("提示","只能编辑一条记录");return;
		     		 }
		     		var tradeType = records[0].data.BUSINESS_TYPE;
		     		var billCode = records[0].data.billCode;
		     		var ladingBillCode = records[0].data.ladingBillCode;
		     		//document.location.href="../consignHandle/consignModify?tradeType="+tradeType+"&billCode="+billCode+"&ladingBillCode="+ladingBillCode;
		     		var url = "../consignHandle/consignModify?tradeType="+encodeURI(tradeType)+"&billCode="+billCode+"&ladingBillCode="+ladingBillCode
		     		document.location.href=encodeURI(url);
				}
			});
			var tbtn3 = Ext.create("Ext.Button", {
			 	text: '申请配载',
			 	handler:function(){
			   	 var records = grid.getSelectionModel().getSelection();
			   	 if(records.length==0){
			     			Ext.Msg.alert("提示","请选择一条记录");return;
			     		}
			     		if(records.length>1){
			     			Ext.Msg.alert("提示","只能编辑一条记录");return;
			     		}
			     		var needful = {
			   					xtype: 'form',
			   					id:'form',
// 			   					title: '必填信息',
			   					layout: 'vbox',
			   					//collapsible: true,
			   					//collapsed: false,
			   					margin: 2,
			   					padding:0,
			   					items: [
			   					        	{
// 			   					        		id："ID",
			   					        		xtype: 'textfield',
			   					        		name: 'ID',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'ID',
			   					        		value:records[0].data.ID,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
			   					        		id:"businessTypeId",
			   					        		xtype: 'textfield',
			   					        		name: 'businessTypeId',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'businessTypeId',
			   					        		value:records[0].data.businessTypeId,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
			   					        		id:"TRANSPORT_CLAUSE",
			   					        		xtype: 'textfield',
			   					        		name: 'TRANSPORT_CLAUSE',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'TRANSPORT_CLAUSE',
			   					        		value:records[0].data.TRANSPORT_CLAUSE,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
			   					        		id:"EMPTY_WEIGHT_BOX",
			   					        		xtype: 'textfield',
			   					        		name: 'EMPTY_WEIGHT_BOX',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'EMPTY_WEIGHT_BOX',
			   					        		value:records[0].data.EMPTY_WEIGHT_BOX,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
			   					        		id:"boxTypeConfirm",
			   					        		xtype: 'textfield',
			   					        		name: 'boxTypeConfirm',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'boxTypeConfirm',
			   					        		value:records[0].data.boxTypeConfirm,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
// 			   					        		id："ID",
			   					        		xtype: 'textfield',
			   					        		name: 'riverUnload',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		id:"riverUnload",
			   					        		fieldLabel: 'riverUnload',
			   					        		value:records[0].data.riverUnload,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
// 			   					        		id："ID",
			   					        		xtype: 'textfield',
			   					        		name: 'riverDelivery',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'riverDelivery',
			   					        		value:records[0].data.riverDelivery,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
// 			   					        		id："ID",
			   					        		xtype: 'textfield',
			   					        		name: 'SETTLE_UNIT',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'SETTLE_UNIT',
			   					        		value:records[0].data.SETTLE_UNIT,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
			   					        		id:"appointShipRoute",
			   					        		xtype: 'textfield',
			   					        		name: 'appointShipRoute',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'appointShipRoute',
			   					        		value:records[0].data.appointShipRoute,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
			   					        		id:"RIVER_LOAD",
			   					        		xtype: 'textfield',
			   					        		name: 'RIVER_LOAD',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'RIVER_LOAD',
			   					        		value:records[0].data.RIVER_LOAD,
// 			   					        		allowBlank:false
			   					        	},
			   					        	{
// 			   					        		id："ID",
			   					        		xtype: 'textfield',
			   					        		name: 'billCode',
			   					        		hidden: true, 
			   					        		hideLabel:true,
			   					        		fieldLabel: 'billCode',
			   					        		value:records[0].data.billCode,
// 			   					        		allowBlank:false
			   					        	},
			   					        	
			   					        	{
			   					        		id:'RIVER_BOAT_NAME1',
			   					             xtype: "combobox",
			   					            name: "RIVER_BOAT_NAME1",
			   					            fieldLabel: "江船名称",
			   					            store: riverShipStore,
// 			   					         	hiddenName : 'SETTLE_COMPANY',
			   					            editable: false,
			   					            displayField: "SHIP_NAME",
			   					            valueField: "SHIP_NAME_ID",
			   					            emptyText: "--请选择--",
// 			   					            queryMode: "local",
											listeners : {
					   					        	 'select' : function(combo,record,opts) { 
					   					        		
					   					        		Ext.getCmp("BOAT_VOYAGE_NAME1").setValue(record[0].data.VOYAGE_NUMBER);
					   					        		Ext.getCmp("BOAT_PLAN_SAIL_TIME1").setValue(record[0].data.SCHEDULED_SAILING_TIME);
					   					        	 }
					   					         }
			   					         	
			   					        },
			   					        	{
			   					        		id:'BOAT_VOYAGE_NAME1',
			   					        		xtype: 'textfield',
			   					        		name: 'BOAT_VOYAGE_NAME',
			   					        		fieldLabel: '航次',
// 			   					        		allowBlank:false,
			   					        		
			   					        	},{
			   					        		id:'BOAT_PLAN_SAIL_TIME1',
			   					        		xtype: 'datefield',
			   					        		name: 'BOAT_PLAN_SAIL_TIME',
			   					        		fieldLabel: '计划开航时间',
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		id:'MATCH_LOAD_REMARK',
			   					        		xtype: 'textarea',
			   					        		name: 'MATCH_LOAD_REMARK',
			   					        		fieldLabel: '配载备注',
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		id:'CONTAINER_TYPE_NUM',
			   					        		xtype: 'textarea',
			   					        		name: 'CONTAINER_TYPE_NUM',
			   					        		fieldLabel: '箱型箱号',
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		id:'TERRITORY_GOODS_SUPPLY',
			   					        		xtype: 'textfield',
			   					        		name: 'TERRITORY_GOODS_SUPPLY',
			   					        		fieldLabel: '境内货源地',
			   					        		value:records[0].data.TERRITORY_GOODS_SUPPLY,
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		id:'PRICE_START_TIME',
			   					        		xtype: 'datefield',
			   					        		name: 'PRICE_START_TIME',
			   					        		fieldLabel: '运价起始有效期',
			   					        		value:records[0].data.PRICE_START_TIME,
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		id:'DESTINATION_COUNTRY',
			   					        		xtype: 'textfield',
			   					        		name: 'DESTINATION_COUNTRY',
			   					        		fieldLabel: '目的国家',
			   					        		value:records[0].data.DESTINATION_COUNTRY,
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		id:'PRICE_STOP_TIME',
			   					        		xtype: 'datefield',
			   					        		name: 'PRICE_STOP_TIME',
			   					        		fieldLabel: '运价结束有效期',
			   					        		value:records[0].data.PRICE_STOP_TIME,
// 			   					        		allowBlank:false
			   					        	},{
// 			   					        		
				   					             xtype: "combo",
				   					             id:"FIO_SETTLEMENT_DEPT",
				   					            name: "FIO_SETTLEMENT_DEPT",
				   					            fieldLabel: "结算单位",
				   					            store: Clearingunit,
//	 			   					         	hiddenName : 'SETTLE_COMPANY',
				   					            //editable: false,
				   					            displayField: "ENTITIES_FULLNAME",
				   					            valueField: "ENTITIES_FULLNAME",
				   					            emptyText: "--请选择--",
//	 			   					            queryMode: "local",
				   					         listeners : {  
				   					            'beforequery':function(e){                
				   					                var combo = e.combo;    
				   					                if(!e.forceAll){    
				   					                var input = e.query;    
				   					                // 检索的正则  
				   					                var regExp = new RegExp(".*" + input + ".*");  
				   					                // 执行检索  
				   					                combo.store.filterBy(function(record,id){    
				   					                // 得到每个record的项目名称值  
				   					                var text = record.get(combo.displayField); 
				   					                return regExp.test(text);   
				   					                });  
				   					                combo.expand();    
				   					                return false;  
				   					                }  
				   					            }  
				   					        }  
				   					         	
				   					        },
				   					     {
				                            	  columnWidth:1/2,
								                    xtype: "checkbox",
								                    id:"IS_FIO",
								                    name: "IS_FIO",
								                    labelWidth: 60,
								                    fieldLabel: "FIO",
								                    inputValue: 'true',
								                   
								                },
								                //{baseCls : 'my-panel-no-border', columnWidth: 2/4,},
			   					        ]
			   			};
			     		var win = Ext.create("Ext.window.Window", {
						    title: '申请配载',
						    width: 800,
						    height: 450,
						   resizable: true,
						    modal: true,
						   closable: true,
						   maximizable: true,
						   minimizable: true,
//			 			   buttons:[save1,clear1,close1],
						   items:[needful],
						   buttons: [{
		       		            text: '保存',
		       		            handler: function(){
		       		            	var form = Ext.getCmp('form').getForm();
		       		            	if(Ext.getCmp('RIVER_BOAT_NAME1').getRawValue()==undefined||Ext.getCmp('RIVER_BOAT_NAME1').getRawValue()==""){
		       		            		Ext.Msg.alert("提示","江船名称不能为空");
		       		            		return 
		       		            	}
		       		            	var tt = form.findField('RIVER_BOAT_NAME1').valueModels[0].data.RIVER_BOAT_NAME;
		       		         	    var FIO_SETTLEMENT_DEPT=Ext.getCmp("FIO_SETTLEMENT_DEPT").getRawValue()//结算类型	       		    	
		       		    		    var IS_FIO = Ext.getCmp('IS_FIO').getValue();//单选FIO		       		            	
		       		            	form.submit({
		       		            		params:{
// 		       		            		billCode:encodeURI(form.findField('billCode').value),
// 		       		            		RIVER_BOAT_NAME_ID:encodeURI(form.findField('RIVER_BOAT_NAME').value),
										RIVER_BOAT_NAME_ID:Ext.getCmp("RIVER_BOAT_NAME1").getValue(),
		       		            		RIVER_BOAT_NAME:Ext.getCmp("RIVER_BOAT_NAME1").getRawValue(),
		       		            		FIO_SETTLEMENT_DEPT : FIO_SETTLEMENT_DEPT,
		       		            		IS_FIO : IS_FIO,
		       		            		BOAT_VOYAGE_NAME:encodeURI(form.findField('BOAT_VOYAGE_NAME').value),
		       		            		BOAT_PLAN_SAIL_TIME:Ext.getCmp("BOAT_PLAN_SAIL_TIME1").getValue(),
		       		            		MATCH_LOAD_REMARK:encodeURI(form.findField('MATCH_LOAD_REMARK').value),
		       		            		CONTAINER_TYPE_NUM:encodeURI(form.findField('CONTAINER_TYPE_NUM').value),
		       		            		RIVER_BOAT_NAME_ID:encodeURI(form.findField('RIVER_BOAT_NAME1').valueModels[0].data.BOAT_ID),
		       		            		SETTLE_COMPANY:form.findField('RIVER_BOAT_NAME1').valueModels[0].data.SETTLE_COMPANY,
// 		       		            		riverUnload:Ext.getCmp("riverUnload").getValue(),
// 		       		            		riverDelivery:Ext.getCmp("riverDelivery").getValue(),
// 		       		            		appointShipRoute:Ext.getCmp("appointShipRoute").getValue(),
		       		            		ID:encodeURI(form.findField('ID').value),
		       		            		
		       		            			
		       		            		},
		       		            		waitTitle : '请稍后...',  
		       		            		waitMsg : '正在保存信息,请稍后...',  
		       		            		url:'../consignHandle/updateConsignHandle',
				          				success:function(form,action){
				          					Ext.Msg.alert("提示","保存成功");
				          					store.load();
				          					win.close();
				          				},

				          			});

		       		            }
		       		        },{
		       		            text: '关闭',
		       		            handler: function(){
		       		            	win.close();
		       		            }
		       		        }]
						});
			   	 		win.show();
			 	}
			});
			var grid1 = Ext.create('Ext.grid.Panel', {
				columnWidth:4/4,
				store: store1,
				id:'grid1',
				hidden: true, 
				height: document.documentElement.clientHeight,
				stripeRows:true,
				columnLines: true,
				selModel:Ext.create('Ext.selection.CheckboxModel',{mode:"single", allowDeselect: true, showHeaderCheckbox:false}),
				columns: [
					{text: 'ID', dataIndex: 'ID',hidden:true},
					{text: '拖车类型', dataIndex: 'TRAILER_TYPE'},
					{text: '拆装箱类型', dataIndex: 'PACKING_TYPE'},
					{text: '地址', dataIndex: 'TRAILER_ADDR'},
					{text: '拖车备注', dataIndex: 'REMARK'},
					{text: '还箱地', dataIndex: 'RETCONTAINERADDR', align: 'left', maxWidth: 100 },
					{text: '拖车日期', dataIndex: 'TRAILER_DATE', maxWidth: 200 },
					{text: '拖车价格', dataIndex: 'TRAILER_PRICE', maxWidth: 80},
					{text: '联系人', dataIndex: 'CONTACT_PERSON', maxWidth: 80},
					{text: '联系方式', dataIndex: 'CONTACT_INFO', maxWidth: 80},
					{text: '拖车完成', dataIndex: 'TRAILER_FINISH', align: 'left', minWidth: 80},
					
				],
			});
			var grid2 = Ext.create('Ext.grid.Panel', {
				columnWidth:4/4,
				store: store1,
				id:'grid2',
				hidden: true, 
				height: document.documentElement.clientHeight,
				stripeRows:true,
				columnLines: true,
				selModel:Ext.create('Ext.selection.CheckboxModel',{mode:"single", allowDeselect: true, showHeaderCheckbox:false}),
				columns: [
					{text: 'ID', dataIndex: 'ID',hidden:true},
					{text: '拖车类型', dataIndex: 'TRAILER_TYPE'},
					{text: '拆装箱类型', dataIndex: 'PACKING_TYPE'},
					{text: '地址', dataIndex: 'TRAILER_ADDR'},
					{text: '拖车备注', dataIndex: 'REMARK'},
					{text: '还箱地', dataIndex: 'RETCONTAINERADDR', align: 'left', maxWidth: 100 },
					{text: '拖车日期', dataIndex: 'TRAILER_DATE', maxWidth: 200 },
					{text: '拖车价格', dataIndex: 'TRAILER_PRICE', maxWidth: 80},
					{text: '联系人', dataIndex: 'CONTACT_PERSON', maxWidth: 80},
					{text: '联系方式', dataIndex: 'CONTACT_INFO', maxWidth: 80},
					{text: '拖车完成', dataIndex: 'TRAILER_FINISH', align: 'left', minWidth: 80},
					
				],
			});
			var grid2 = Ext.create('Ext.grid.Panel', {
				columnWidth:4/4,
				store: store1,
				id:'grid2',
				hidden: true, 
				height: document.documentElement.clientHeight,
				stripeRows:true,
				columnLines: true,
				selModel:Ext.create('Ext.selection.CheckboxModel',{mode:"single", allowDeselect: true, showHeaderCheckbox:false}),
				columns: [
					{text: 'ID', dataIndex: 'ID',hidden:true},
					{text: '拖车类型', dataIndex: 'TRAILER_TYPE'},
					{text: '拆装箱类型', dataIndex: 'PACKING_TYPE'},
					{text: '地址', dataIndex: 'TRAILER_ADDR'},
					{text: '拖车备注', dataIndex: 'REMARK'},
					{text: '还箱地', dataIndex: 'RETCONTAINERADDR', align: 'left', maxWidth: 100 },
					{text: '拖车日期', dataIndex: 'TRAILER_DATE', maxWidth: 200 },
					{text: '拖车价格', dataIndex: 'TRAILER_PRICE', maxWidth: 80},
					{text: '联系人', dataIndex: 'CONTACT_PERSON', maxWidth: 80},
					{text: '联系方式', dataIndex: 'CONTACT_INFO', maxWidth: 80},
					{text: '拖车完成', dataIndex: 'TRAILER_FINISH', align: 'left', minWidth: 80},
					
				],
			});
			var tbtn4 = Ext.create("Ext.Button", {
				text: '服务项维护',
			 	handler:function(){
			 		 var records = grid.getSelectionModel().getSelection();
				   	 if(records.length==0){
				     			Ext.Msg.alert("提示","请选择一条记录");return;
				     		}
				     		if(records.length>1){
				     			Ext.Msg.alert("提示","只能编辑一条记录");return;
				     		}
				     		
				     		var needful = {
				   					xtype: 'form',
				   					id:'form',
//	 			   					title: '必填信息',
				   					 layout:'column',
				   					 height: 600,
				   					//collapsible: true,
				   					//collapsed: false,
				   					 region:'center',  
								    //内容溢出自动滚动  
								    autoScroll:true, 
				   					fieldDefaults: {
// 		 				        			labelWidth: 90,
		 				        			labelAlign: "left",
		 				        			//flex: 1,
// 		 				        			margin: 5,
											margin : '10 10 10 10',
		 				        			labelStyle: 'color:green;'
		 				        		},
				   					margin: 2,
				   					padding:0,
				   					items: [
				   					        	{
//	 			   					        		id："ID",
				   					        		xtype: 'textfield',
				   					        		name: 'ID',
				   					        		hidden: true, 
				   					        		hideLabel:true,
				   					        		fieldLabel: 'ID',
				   					        		value:records[0].data.ID,
//	 			   					        		allowBlank:false
				   					        	},{
//	 			   					        		id："ID",
				   					        		xtype: 'textfield',
				   					        		name: 'billCode',
				   					        		hidden: true, 
				   					        		hideLabel:true,
				   					        		fieldLabel: 'billCode',
				   					        		value:records[0].data.billCode,
//	 			   					        		allowBlank:false
				   					        	},
				   					        	{
//	 			   					        		id：'RIVER_BOAT_NAME',
				   					             xtype: "combobox",
				   					            name: "CUS_MOD_ID",
				   					            fieldLabel: "报关方式",
				   					            store: customsMode,
				   					         	labelWidth: 60,
//	 			   					         	hiddenName : 'SETTLE_COMPANY',
				   					            editable: false,
				   					         	columnWidth:1/4,
				   					            displayField: "CUSTOMS_DECLARATION_MODE",
				   					            valueField: "ID",
				   					         	value:records[0].data.cusModId,
				   					            emptyText: "--请选择--",
				   					         	
				   					        },{
// 			   					        		id：'RIVER_BOAT_NAME',
				   					             xtype: "combobox",
				   					            name: "CUS_BRO_ID",
				   					            fieldLabel: "报关行",
				   					         labelWidth: 60,
				   					            store: customs,
//	 			   					         	hiddenName : 'SETTLE_COMPANY',
				   					            editable: false,
				   					         	columnWidth:1/4,
				   					            displayField: "CUSTOMS_BROKER_NAME",
				   					            valueField: "ID",
				   					     	value:records[0].data.cusBroId,
				   					            emptyText: "--请选择--",
				   					         	
				   					        },
			   					        	
				   					        {
//	 			   					        		id:'BOAT_VOYAGE_NAME',
				   					        		xtype: 'textfield',
				   					        		name: 'CUSTOMS_NUM',
				   					        		columnWidth:1/4,
				   					        		labelWidth: 60,
				   					        		fieldLabel: '报关票数',
// 				   					        		value:records[0].data.commodityInspectionNum,
//	 			   					        		allowBlank:false,
				   					        		
				   					        	},{
//	 			   					        		id:'PLAN_SAIL_TIME',
				   					        		xtype: 'textfield',
				   					        		name: 'COMMODITY_INSPECTION_NUM',
				   					        		columnWidth:1/4,
				   					        		labelWidth: 60,
				   					        		fieldLabel: '商检票数',
				   					        		value:records[0].data.commodityInspectionNum,
//	 			   					        		allowBlank:false
				   					        	},{
	 			   					        		id:'BILL_TYPE1',
					   					             xtype: "combo",
					   					            name: "BILL_TYPE",
					   					            fieldLabel: "提单类型",
					   					            labelWidth: 60,
					   					            store: billType,
//		 			   					         	hiddenName : 'SETTLE_COMPANY',
					   					            editable: false,
					   					         	columnWidth:1/4,
					   					            displayField: "LADING_BILL_TYPE",
					   					            value:records[0].data.BILL_TYPE,
					   					            valueField: "ID",
					   					           /*  emptyText: "--请选择--", */
					   					           	listeners : { //监听该下拉列表的选择事件
									select : function(combo, record, index) {				
										var ID = Ext.getCmp('BILL_TYPE1').getValue();										
										 var a=Ext.getCmp('billID').setValue(ID.toString());//给文本框赋值
									}
									
									}
					   					         	
					   					        },
					   					     {
	 			   					        		id:'billID',
				   					        		xtype: 'textarea',
				   					        		labelWidth: 60,
				   					        		name: 'billID',
				   					        		columnWidth:1/4,
				   					        		hidden:true,
				   					        		//value:records[0].data.MATCH_LOAD_REMARK,
				   					        		fieldLabel: '提单类型ID',
//	 			   					        		allowBlank:false
				   					        	},
					   					     {
//	 			   					        		id:'MATCH_LOAD_REMARK',
				   					        		xtype: 'textarea',
				   					        		labelWidth: 60,
				   					        		name: 'MATCH_LOAD_REMARK',
				   					        		columnWidth:1/4,
				   					        		value:records[0].data.MATCH_LOAD_REMARK,
				   					        		fieldLabel: '报关要求',
//	 			   					        		allowBlank:false
				   					        	},
				   					        	{
//	 			   					        		id:'MATCH_LOAD_REMARK',
				   					        		xtype: 'textarea',
				   					        		name: 'MATCH_LOAD_REMARK',
				   					        		columnWidth:1/4,
				   					        		labelWidth: 60,
				   					        		fieldLabel: '追加要求',
//	 			   					        		allowBlank:false
				   					        	},{
					   					        	columnWidth:1/4,
					                                  layout: 'form',
					                                  
					                                  items: [
					                                   new Ext.Button({
					                                    text:'导出报关计划',
					                                    handler:function(){
					                                    	exportFile("customsPlan",records[0].data.billCode);
					                                    }        
					                                   })
					                                  ]
					                              },{baseCls : 'my-panel-no-border', columnWidth: 2/4,},
					                              {
//	 			   					        		id：'RIVER_BOAT_NAME',
					   					             xtype: "combobox",
					   					          labelWidth: 60,
					   					            name: "AGENCY_INSURANCE",
					   					            fieldLabel: "代办保险",
					   					            store: riverShipStore,
//		 			   					         	hiddenName : 'SETTLE_COMPANY',
													store:insuranceStore,
					   					            editable: false,
					   					         	columnWidth:1/4,
					   					         	value:records[0].data.agencyInsurance,
					   					            displayField: "name",
					   					            valueField: "id",
					   					            emptyText: "--请选择--",
					   					         listeners:{

					   					          'select':function(combo,record,opts) { 
					   					        	var insurance = record[0].data.id
					   					        	if(insurance=='1'){
					   					        		Ext.getCmp('INSURANCE_NAME').show();
					   					        		Ext.getCmp('INSURANCE_AMOUNT').show();
					   					        		Ext.getCmp('INSURANCE_RATE').show();
					   					        		Ext.getCmp('INSURANCE_REMARK').show();
					   					        	}else{
					   					        		Ext.getCmp('INSURANCE_NAME').hide();
					   					        		Ext.getCmp('INSURANCE_AMOUNT').hide();
					   					        		Ext.getCmp('INSURANCE_RATE').hide();
					   					        		Ext.getCmp('INSURANCE_REMARK').hide();
					   					        		Ext.getCmp('INSURANCE_NAME').setValue(null);
					   					        		Ext.getCmp('INSURANCE_AMOUNT').setValue(null);
					   					        		Ext.getCmp('INSURANCE_RATE').setValue(null);
					   					        		Ext.getCmp('INSURANCE_REMARK').setValue(null);
					   					        		
					   					        	}
					   					          } 

					   					         } 
					   					        },{
					   					        	columnWidth:1/4,
					                                  layout: 'form',
					                                  items: [
					                                   new Ext.Button({
					                                    text:'导出保险申请单',
					                                    handler:function(){
					                                    	exportFile("insurance",records[0].data.billCode);
					                                    }        
					                                   })
					                                  ]
					                              },
// 					                              { 
// 					                            	  columnWidth:1/6,
// // 					                            	  fieldLabel: '是否熏蒸:', 
// 					                            	  boxLabel: '是否熏蒸', 
// 					                            	  name:'integrity', 
// 					                            	  inputValue: '1' 
// 					                            	  },
					                              , {
					                            	  columnWidth:1/4,
									                    xtype: "checkboxfield",
									                    name: "IS_FUMIGATION",
									                    labelWidth: 60,
									                    fieldLabel: "是否熏蒸",
									                    value:records[0].data.isFumigation,
									                    inputValue: '1',

									                },
									                {baseCls : 'my-panel-no-border', columnWidth: 2/4,},
									                {
		 			   					        		id:'INSURANCE_NAME',
					   					        		xtype: 'textfield',
					   					        		name: 'INSURANCE_NAME',
					   					        		columnWidth:1/4,
					   					        		labelWidth: 60,
						   					        	hidden: true,
// 						   					            hideLabel: true,
					   					        		fieldLabel: '保险名称',
					   					        	 	value:records[0].data.insuranceName,
//		 			   					        		allowBlank:false
					   					        	},{
		 			   					        		id:'INSURANCE_AMOUNT',
					   					        		xtype: 'textfield',
					   					        		name: 'INSURANCE_AMOUNT',
					   					        		columnWidth:1/4,
					   					        		labelWidth: 60,
					   					        		hidden: true,
					   					        		fieldLabel: '保险金额',
					   					        		value:records[0].data.insuranceAmount,
//		 			   					        		allowBlank:false
					   					        	},{
		 			   					        		id:'INSURANCE_RATE',
					   					        		xtype: 'textfield',
					   					        		name: 'INSURANCE_RATE',
					   					        		columnWidth:1/4,
					   					        		labelWidth: 60,
					   					        		hidden: true,
					   					        		fieldLabel: '保险比率',
					   					        		value:records[0].data.insuranceRate,
//		 			   					        		allowBlank:false
					   					        	},{
		 			   					        		id:'INSURANCE_REMARK',
					   					        		xtype: 'textarea',
					   					        		name: 'INSURANCE_REMARK',
					   					        		columnWidth:1/4,
					   					        		labelWidth: 60,
					   					        		hidden: true,
					   					        		fieldLabel: '保险备注',
					   					        		value:records[0].data.insuranceRemark,
//		 			   					        		allowBlank:false
					   					        	},
					   					        	{baseCls : 'my-panel-no-border', columnWidth: 4/4,},
// 					   					        	{
// 									                	columnWidth:1/4,
// 									                	xtype: 'fieldcontainer',  
// 									                     defaultType: 'checkboxfield', 
// 									                     labelWidth: 60,
// 									                    name: "swim",
// 									                    fieldLabel: "装箱方式",
// 									                    items: [
// 									                    	{
// 									                        boxLabel  : '厂装',  
// 									                        name      : 'hobby',  
// 									                        inputValue: '1',  
// 									                        id        : 'sing'  
// 									                    }, { 
// 									                        boxLabel  : '港装',  
// 									                        name      : 'hobby',  
// 									                        inputValue: '2',   
// 									                        id        : 'dance'  
// 									                    }]
// 									                },
													{
// 										                xtype: 'checkbox',
// 										                columnWidth:1/4,
// 										                name: 'tt',
// 										                fieldLabel: '装箱方式',
// 										                boxLabel: '厂装',
// 										                name: 'fav-animal-dog',

														columnWidth:1/4,
										                xtype: 'checkboxgroup',    
										                fieldLabel: '装箱方式',     
										                layout:'auto',
										                id:'ENCASEMENT_METHOD',
										                value:records[0].data.encasementMethod,
// 										                columns: 3,     
										                items: [     
										                    {name: '1',boxLabel: '厂装',inputValue:0},     
										                    {name: '2',boxLabel: '港装',inputValue:1},     
    
										                ],
										                listeners:{
										                    'change':function(cbgroup, checked){
										                    	 var chkLableValue = Ext.getCmp('ENCASEMENT_METHOD').getChecked();
// 										                    	 alert(chkLableValue);
										                    	 var lblValue = [];
										                         Ext.Array.each(chkLableValue, function (item) {
										                             lblValue.push(item.inputValue);
										                         });
										                        if(lblValue[0]==0 && lblValue.length==1){
										                        	Ext.getCmp('FACTORY_CONTAINER_TYPE_NUM').show();
										                        	Ext.getCmp('PORT_CONTAINER_TYPE_NUM').hide();
								   					        		Ext.getCmp('LOAD_CONTAINER_TIME').hide();
								   					        		Ext.getCmp('APPOINT_PUT_CONTAINER_TIME').hide();
								   					        		Ext.getCmp('PORT_SPLIT_REQUIREMENTS').hide();
								   					        		Ext.getCmp('GOODS_NUM').hide();
								   					        		Ext.getCmp('GOODS_GROSS_WEIGHT').hide();
								   					        		Ext.getCmp('VOLUME').hide();
								   					        		Ext.getCmp('UNIT').hide()
										                        }else if(lblValue[0]==1&&lblValue.length==1){
										                        	Ext.getCmp('PORT_CONTAINER_TYPE_NUM').show();
								   					        		Ext.getCmp('LOAD_CONTAINER_TIME').show();
								   					        		Ext.getCmp('APPOINT_PUT_CONTAINER_TIME').show();
								   					        		Ext.getCmp('PORT_SPLIT_REQUIREMENTS').show();
								   					        		Ext.getCmp('GOODS_NUM').show();
								   					        		Ext.getCmp('GOODS_GROSS_WEIGHT').show();
								   					        		Ext.getCmp('VOLUME').show();
								   					        		Ext.getCmp('UNIT').show();
								   					        		Ext.getCmp('FACTORY_CONTAINER_TYPE_NUM').hide();
										                        }else if(lblValue.length>1){
										                        	Ext.getCmp('FACTORY_CONTAINER_TYPE_NUM').show();
										                        	Ext.getCmp('PORT_CONTAINER_TYPE_NUM').show();
								   					        		Ext.getCmp('LOAD_CONTAINER_TIME').show();
								   					        		Ext.getCmp('APPOINT_PUT_CONTAINER_TIME').show();
								   					        		Ext.getCmp('PORT_SPLIT_REQUIREMENTS').show();
								   					        		Ext.getCmp('GOODS_NUM').show();
								   					        		Ext.getCmp('GOODS_GROSS_WEIGHT').show();
								   					        		Ext.getCmp('VOLUME').show();
								   					        		Ext.getCmp('UNIT').show();
										                        }
										                        else
										                        {
										                        	Ext.getCmp('FACTORY_CONTAINER_TYPE_NUM').hide();
										                        	Ext.getCmp('PORT_CONTAINER_TYPE_NUM').hide();
								   					        		Ext.getCmp('LOAD_CONTAINER_TIME').hide();
								   					        		Ext.getCmp('APPOINT_PUT_CONTAINER_TIME').hide();
								   					        		Ext.getCmp('PORT_SPLIT_REQUIREMENTS').hide();
								   					        		Ext.getCmp('GOODS_NUM').hide();
								   					        		Ext.getCmp('GOODS_GROSS_WEIGHT').hide();
								   					        		Ext.getCmp('VOLUME').hide();
								   					        		Ext.getCmp('UNIT').hide();
										                        }
										                    }
										                }
										                   
										            },
// 										            {
// 										                xtype: 'checkbox',
// 										                columnWidth:1/4,
// 										                boxLabel: '港装',
// 										                name: 'fav-animal-dog',
// 										                listeners:{
// 										                    'change':function(obj,ischecked){
										                        
// 										                    }
// 										                }
// 										            },
									                {baseCls : 'my-panel-no-border', columnWidth: 4/4,},
									                {
					   					        		xtype: 'textfield',
					   					        		id:'FACTORY_CONTAINER_TYPE_NUM',
					   					        		name: 'FACTORY_CONTAINER_TYPE_NUM',
					   					        		hidden: true,
					   					        		columnWidth:3/4,
					   					        		fieldLabel: '厂装箱型',
					   					        		labelWidth: 60,
					   					        	 	value:records[0].data.factoryContainerTypeNum,
//		 			   					        		allowBlank:false
					   					        	},
					   					        	{
					   					        		xtype: 'textfield',
					   					        		id:'PORT_CONTAINER_TYPE_NUM',
					   					        		name: 'PORT_CONTAINER_TYPE_NUM',
					   					        		columnWidth:3/4,
					   					        		fieldLabel: '港装箱型',
					   					        		value:records[0].data.portContainerTypeNum,
					   					        		hidden: true,
					   					        		labelWidth: 60,
//		 			   					        		allowBlank:false
					   					        	},
					   					        	{baseCls : 'my-panel-no-border', columnWidth: 2/4,},
					   					        	{
		 			   					        		id:'LOAD_CONTAINER_TIME',
					   					        		xtype: 'datefield',
					   					        		labelWidth: 60,
					   					        		hidden: true,
					   					        		name: 'LOAD_CONTAINER_TIME',
					   					        		columnWidth:1/4,
					   					        		fieldLabel: '装箱时间',
					   					        		value:records[0].data.loadContainerTime,
//		 			   					        		allowBlank:false
					   					        	},
					   					        	
					   					        	{
		 			   					        		id:'APPOINT_PUT_CONTAINER_TIME',
					   					        		xtype: 'datefield',
					   					        		name: 'APPOINT_PUT_CONTAINER_TIME',
					   					        		columnWidth:1/4,
					   					        		labelWidth: 60,
					   					        		hidden: true,
					   					        		value:records[0].data.appointPutContainerTime,
					   					        		fieldLabel: '预约摆箱时间',
//		 			   					        		allowBlank:false
					   					        	},{
					   					        		xtype: 'textarea',
					   					        		id:'PORT_SPLIT_REQUIREMENTS',
					   					        		name: 'PORT_SPLIT_REQUIREMENTS',
					   					        		columnWidth:1/4,
					   					        		labelWidth: 60,
					   					        		hidden: true,
					   					        		value:records[0].data.portSplitRequirements,
					   					        		fieldLabel: '港装备注',
//		 			   					        		allowBlank:false
					   					        	},
					   					        	{baseCls : 'my-panel-no-border', columnWidth: 2/4,},
					   					        	{
					   					        		xtype: 'textfield',
					   					        		name: 'GOODS_NUM',
					   					        		id:'GOODS_NUM',
					   					        		columnWidth:1/4,
					   					        		hidden: true,
					   					        		labelWidth: 90,
					   					        		fieldLabel: '货物件数及单位',
					   					        		value:records[0].data.goodsNum,
//		 			   					        		allowBlank:false
					   					        	},{
					   					        		id:'GOODS_UNIT',
					   					        		xtype: 'textfield',
					   					        		name: 'GOODS_UNIT',
					   					        		hidden: true,
					   					        		columnWidth:1/10,
					   					        		value:records[0].data.goodsUnit,
//		 			   					        		allowBlank:false
					   					        	},
					   					        	{
					   					        		id:'GOODS_GROSS_WEIGHT',
					   					        		xtype: 'textfield',
					   					        		name: 'GOODS_GROSS_WEIGHT',
					   					        		hidden: true,
					   					        		columnWidth:1/4,
					   					        		fieldLabel: '货物毛重',
					   					        		value:records[0].data.goodsGrossWeight,
					   					        		labelWidth: 60,
//		 			   					        		allowBlank:false
					   					        	},
					   					        	{
					   					        		xtype: 'textfield',
					   					        		name: 'VOLUME',
					   					        		id:'VOLUME',
					   					        		hidden: true,
					   					        		columnWidth:1/4,
					   					        		fieldLabel: '体积',
					   					        		value:records[0].data.volume,
					   					        		labelWidth: 60,
//		 			   					        		allowBlank:false
					   					        	},{
//		 			   					        		id：'RIVER_BOAT_NAME',
						   					             xtype: "combobox",
						   					          labelWidth: 90,
						   					            name: "IS_ARRANGE_TRAILER",
						   					            fieldLabel: "是否安排拖车",
						   					         	value:records[0].data.isArrangeTrailer,
//			 			   					         	hiddenName : 'SETTLE_COMPANY',
														store:trailerStore,
						   					            editable: false,
						   					         	columnWidth:1/4,
						   					            displayField: "name",
						   					            valueField: "id",
						   					            emptyText: "--请选择--",
						   					         listeners:{

							   					          'select':function(combo,record,opts) { 
							   					        	var insurance = record[0].data.id
							   					        	if(insurance=='0'){
							   					        		Ext.getCmp('edit').show();
							   					        		Ext.getCmp('Info').show();
// 							   					        		store1.load();
																var BILL_CODE =	records[0].data.billCode
							   					        		var store = Ext.getCmp('grid1').getStore();
							   								store.on('beforeload', function(store,options) {  
							   								            var new_params = {  
							   								            		BILL_CODE:BILL_CODE
							   								            };  
							   								//这里apply一下实现新的proxy  
							   								            Ext.apply(store.proxy.extraParams,new_params);  
							   								        });  
							   								//对store重新载入  
							   								        store.load();  
							   					        	}else{
							   					        		Ext.getCmp('grid1').hide();
							   					        		Ext.getCmp('edit').hide();
							   					        		Ext.getCmp('Info').hide();
							   					        	}
							   					          } 

							   					         }
						   					        },{
						   					        	columnWidth:1/4,
						                                  layout: 'form',
						                                  id:'edit',
						                                  hidden:true,
						                                  items: [
						                                   new Ext.Button({
						                                    text:'编辑拖车信息',
						                                    handler:function(){
						                                    	Ext.getCmp('grid2').show();
						                                    	var win2 = new Ext.Window({ 
						                                    		 title: '拖车信息',
						             							    width: '80%',
						             							    height: '70%',
						             							   resizable: true,
						             							    modal: true,
						             							   closable: true,
						             							  closeAction : 'hide',  
						             							 	closable : true,// 是否有关闭  
						             							   maximizable: true,
						             							   minimizable: true,
						             							  listeners   : {'hide':{fn:tt }},  
						             							  items:[{xtype: 'form',
						             				   					id:'form1',
//						            	 			   					title: '必填信息',
						            				   					 layout:'column',
						            				   					 height: 600,
						            				   					//collapsible: true,
						            				   					//collapsed: false,
						            				   					 region:'center',  
						            								    //内容溢出自动滚动  
						            								    autoScroll:true, 
						            				   					fieldDefaults: {
//						             		 				        			labelWidth: 90,
						            		 				        			labelAlign: "left",
						            		 				        			//flex: 1,
//						             		 				        			margin: 5,
						            											margin : '10 10 10 10',
						            		 				        			labelStyle: 'color:green;'
						            		 				        		},
						            				   					margin: 2,
						            				   					padding:0,
						            				   					items: [{
							 			   					        		id:'tID',
										   					        		xtype: 'textfield',
										   					        		name: 'tID',
										   					        		hidden: true, 
										   					        		hideLabel:true,
										   					        		value:records[0].data.ID,
//							 			   					        		allowBlank:false
										   					        	},{
							 			   					        		id:'TRAILER_TYPE',
						   				   					             xtype: "combobox",
						   				   					            name: "TRAILER_TYPE",
						   				   					            fieldLabel: "拖车类型",
						   				   					            store: trailerType,
						   				   					         	labelWidth: 60,
//						   	 			   					         	hiddenName : 'SETTLE_COMPANY',
						   				   					            editable: false,
						   				   					         	columnWidth:1/3,
						   				   					            displayField: "name",
						    				   					           valueField: "id",
						   				   					            emptyText: "--请选择--",
						   				   					         	
						   				   					        },{
						 			   					        		id:'TRAILER_DATE',
									   					        		xtype: 'datefield',
									   					        		labelWidth: 60,
									   					        		
									   					        		name: 'TRAILER_DATE',
									   					        		columnWidth:1/3,
									   					        		fieldLabel: '拖车时间',
//						 			   					        		allowBlank:false
									   					        	},{
									 			   					        		id:'PACKING_TYPE',
									   				   					             xtype: "combobox",
									   				   					            name: "PACKING_TYPE",
									   				   					            fieldLabel: "拆装箱类型",
									   				   					            store: boxType,
									   				   					         	labelWidth: 60,
//									   	 			   					         	hiddenName : 'SETTLE_COMPANY',
									   				   					            editable: false,
									   				   					         	columnWidth:1/3,
									   				   					            displayField: "name",
									    				   					            valueField: "id",
									   				   					            emptyText: "--请选择--",
									   				   					         	
									   				   					  },
									   				   						{	
											   					        		xtype: 'textarea',
											   					        		id:'TRAILER_ADDR',
											   					        		name: 'TRAILER_ADDR',
											   					        		columnWidth:1/3,
											   					        		labelWidth: 60,
											   					        		
											   					        		fieldLabel: '地址',
//								 			   					        		allowBlank:false
											   					        	},
											   					        	{	
											   					        		xtype: 'textarea',
											   					        		id:'REMARK',
											   					        		name: 'REMARK',
											   					        		columnWidth:1/3,
											   					        		labelWidth: 60,
											   					        		
											   					        		fieldLabel: '拖车备注',
//								 			   					        		allowBlank:false
											   					        	},
											   					        	{	
											   					        		xtype: 'textarea',
											   					        		id:'RETCONTAINERADDR',
											   					        		name: 'RETCONTAINERADDR',
											   					        		columnWidth:1/3,
											   					        		labelWidth: 60,
											   					        		
											   					        		fieldLabel: '还箱地',
//								 			   					        		allowBlank:false
											   					        	},{
											   					        		xtype: 'textfield',
											   					        		id:'TRAILER_PRICE',
											   					        		name: 'TRAILER_PRICE',
											   					        		columnWidth:1/3,
											   					        		fieldLabel: '拖车价格',
											   					        		
											   					        		labelWidth: 60,
//								 			   					        		allowBlank:false
											   					        	},{
											   					        		xtype: 'textfield',
											   					        		id:'CONTACT_PERSON',
											   					        		name: 'CONTACT_PERSON',
											   					        		columnWidth:1/3,
											   					        		fieldLabel: '联系人',
											   					        		
											   					        		labelWidth: 60,
//								 			   					        		allowBlank:false
											   					        	},{
											   					        		xtype: 'textfield',
											   					        		id:'CONTACT_INFO',
											   					        		name: 'CONTACT_INFO',
											   					        		columnWidth:1/3,
											   					        		fieldLabel: '联系方式',
											   					        		
											   					        		labelWidth: 60,
//								 			   					        		allowBlank:false
											   					        	},
											   					        	{
												   					        	columnWidth:1/6,
												                                  layout: 'form',
												                                  items: [
												                                   new Ext.Button({
												                                    text:'新增',
												                                    handler:function(){
												                                    	var form = Ext.getCmp('form1').getForm();	
												                                    	var a=Ext.getCmp('TRAILER_TYPE').getRawValue();
												                                    	alert(a)
												                                    	if(Ext.getCmp('TRAILER_TYPE').getRawValue()==""||Ext.getCmp('PACKING_TYPE').getRawValue()==""||Ext.getCmp('TRAILER_TYPE').getRawValue().indexOf("请选择")!=-1||Ext.getCmp('PACKING_TYPE').getRawValue().indexOf("请选择")!=-1){
												                                    		Ext.Msg.alert("提示","拖车类型和拆装箱类型不能为空");return;
												    		       		            		return 
												    		       		            	}
												                                    	form.submit({
												     		       		            		params:{
												     		       		            		TRAILER_TYPE:encodeURI(form.findField('TRAILER_TYPE').value),
												     		       		            		PACKING_TYPE:encodeURI(form.findField('PACKING_TYPE').value),
												     		       		            		REMARK:form.findField('REMARK').value,
													     		       		            	RETCONTAINERADDR:encodeURI(form.findField('RETCONTAINERADDR').value),
														     		       		            TRAILER_ADDR:encodeURI(form.findField('TRAILER_ADDR').value),
													     		       		        		TRAILER_DATE:form.findField('TRAILER_DATE').value,
														     		       		        	TRAILER_PRICE:encodeURI(form.findField('TRAILER_PRICE').value),
														     		       		        	CONTACT_PERSON:encodeURI(form.findField('CONTACT_PERSON').value),
														     		       		        	CONTACT_INFO:form.findField('CONTACT_INFO').value,
														     		       		    		BILL_CODE:records[0].data.billCode,
													     		       		        		
// 												     		       		            		ID:encodeURI(form.findField('ID').value),
												     		       		            			
												     		       		            		},
												     		       		            		waitTitle : '请稍后...',  
												     		       		            		waitMsg : '正在保存信息,请稍后...',  
												     		       		            		url:'../consignHandle/saveOrUpdate',
																	          				success:function(form,action){
																	          					Ext.Msg.alert("提示","保存成功");
																	          					store1.load();
																	          					Ext.getCmp("TRAILER_TYPE").setValue(null); 
																								Ext.getCmp("PACKING_TYPE").setValue(null); 
																								Ext.getCmp("REMARK").setValue(null); 
																								Ext.getCmp("RETCONTAINERADDR").setValue(null); 
																								Ext.getCmp("TRAILER_ADDR").setValue(null); 
																								Ext.getCmp("TRAILER_DATE").setValue(null); 
																								Ext.getCmp("TRAILER_PRICE").setValue(null);  
																								Ext.getCmp("CONTACT_PERSON").setValue(null); 
																								Ext.getCmp("CONTACT_INFO").setValue(null); 
// 																	          					win.close();
																	          				},

																	          			})
												                                    }        
												                                   })
												                                  ]
												                              },
												                              {
													   					        	columnWidth:1/6,
													                                  layout: 'form',
													                                  items: [
													                                   new Ext.Button({
													                                    text:'编辑',
													                                    handler:function(){
													                                    	 var records1 = grid2.getSelectionModel().getSelection();
													                        	        	 if(records1.length==0){
													                        		       			Ext.Msg.alert("提示","请选择需要编辑的记录");return;
													                        		       		}
													                        		       		if(records1.length>1){
													                        		       			Ext.Msg.alert("提示","只能编辑一条记录");return;
													                        		       		}
													                        		   			  Ext.getCmp('tID').setValue(records1[0].data.ID);
													                        		     			if(records1[0].data.TRAILER_TYPE==1){
													                        		     				Ext.getCmp('TRAILER_TYPE').setValue("起运港拖车");
													                        		     			}else{
													                        		     				Ext.getCmp('TRAILER_TYPE').setValue("目的港拖车");
													                        		     			}
													                        		     	     	if(records1[0].data.PACKING_TYPE==1){
													                        		     	     		Ext.getCmp('PACKING_TYPE').setValue("拆箱");
													                        		     	     	}else{
													                        		     	     		Ext.getCmp('PACKING_TYPE').setValue("装箱");
													                        		     	     	}
													                        		        		Ext.getCmp('REMARK').setValue(records1[0].data.REMARK);
													                        		        		Ext.getCmp('RETCONTAINERADDR').setValue(records1[0].data.RETCONTAINERADDR);
													                        		        		Ext.getCmp('TRAILER_ADDR').setValue(records1[0].data.TRAILER_ADDR);
													                        		        		Ext.getCmp('TRAILER_DATE').setValue(Ext.util.Format.date(new Date(records1[0].data.TRAILER_DATE), 'd/m/Y'));
													                        		        		Ext.getCmp('TRAILER_PRICE').setValue(records1[0].data.TRAILER_PRICE);
													                        		        		Ext.getCmp('CONTACT_PERSON').setValue(records1[0].data.CONTACT_PERSON);
													                        		        		Ext.getCmp('CONTACT_INFO').setValue(records1[0].data.CONTACT_INFO);
													                        		        
													                                    }        
													                                   })
													                                  ]
													                              },{
														   					        	columnWidth:1/6,
														                                  layout: 'form',
														                                  items: [
														                                   new Ext.Button({
														                                    text:'保存编辑信息',
														                                    handler:function(){   
														                        		        		var form = Ext.getCmp('form1').getForm();
														                        		        		
																                                    	form.submit({
																     		       		            		params:{
																     		       		            		
																     		       		            		REMARK:form.findField('REMARK').value,
																	     		       		            	RETCONTAINERADDR:encodeURI(form.findField('RETCONTAINERADDR').value),
																		     		       		            TRAILER_ADDR:encodeURI(form.findField('TRAILER_ADDR').value),
																	     		       		        		TRAILER_DATE:form.findField('TRAILER_DATE').value,
																		     		       		        	TRAILER_PRICE:encodeURI(form.findField('TRAILER_PRICE').value),
																		     		       		        	CONTACT_PERSON:encodeURI(form.findField('CONTACT_PERSON').value),
																		     		       		        	CONTACT_INFO:form.findField('CONTACT_INFO').value,
																		     		       		    		BILL_CODE:records[0].data.billCode,
																	     		       		        		
				 												     		       		            		ID:encodeURI(form.findField('tID').value),
																     		       		            			
																     		       		            		},
																     		       		            		waitTitle : '请稍后...',  
																     		       		            		waitMsg : '正在保存信息,请稍后...',  
																     		       		            		url:'../consignHandle/saveOrUpdate',
																					          				success:function(form,action){
																					          					Ext.Msg.alert("提示","编辑成功");
																					          					store1.load();
																					          					Ext.getCmp("TRAILER_TYPE").setValue(null); 
																												Ext.getCmp("PACKING_TYPE").setValue(null); 
																												Ext.getCmp("REMARK").setValue(null); 
																												Ext.getCmp("RETCONTAINERADDR").setValue(null); 
																												Ext.getCmp("TRAILER_ADDR").setValue(null); 
																												Ext.getCmp("TRAILER_DATE").setValue(null); 
																												Ext.getCmp("TRAILER_PRICE").setValue(null);  
																												Ext.getCmp("CONTACT_PERSON").setValue(null); 
																												Ext.getCmp("CONTACT_INFO").setValue(null); 
//				 																	          					win.close();
																					          				},

																					          			})
														                                    }        
														                                   })
														                                  ]
														                              },
													                              {
														   					        	columnWidth:1/6,
														                                  layout: 'form',
														                                  items: [
														                                   new Ext.Button({
														                                    text:'删除',
														                                    handler:function(){
														                                    	var records = grid2.getSelectionModel().getSelection();
														                    	       			if(records.length==0){
														                    	       				Ext.Msg.alert("提示","请选中需要删除的记录");return;
														                    	       			}
														                    	       			var arr = [];
														                    	       			Ext.each(records,function(item){
														                    	       				obj = {
														                    	       						id:item.data.ID
														                    	       				};
														                    	       				arr.push(obj);
														                    	       			});
														                    	       			var array = JSON.stringify(arr);
														                    	       			Ext.Msg.confirm("提示","确定删除数据?",function(btn){
														                    		       				
														                    		       					Ext.Ajax.request({
														                    		       						url:'../consignHandle/deleteTrailer',
														                    		       						params:{
														                    		       							array:array
														                    		       						},
														                    		       						timeout:5000,
														                    		       						success:function(response){
														                    		       							store1.load();
														                    		       							Ext.Msg.alert("成功","删除成功!");
														                    		       						},
														                    		       						failure:function(response){
														                    		       							Ext.Msg.alert("错误","请求异常!");
														                    		       						}
														                    		       					});
														                    		       				
														                    		       			});
														                                    }        
														                                   })
														                                  ]
														                              },grid2,
						            				   					        ]
						             							  }],
						                                    	});
						                                    	win2.show();
						                                    }        
						                                   })
						                                  ]
						                              },
						                              {
							   					        	columnWidth:1/4,
							                                  layout: 'form',
							                                  id:'Info',
							                                  hidden:true,
							                                  items: [
							                                   new Ext.Button({
							                                    text:'导出拖车信息',
							                                    handler:function(){
							                                    	var records1 = grid1.getSelectionModel().getSelection();
							            				     		if(records1.length==0){
							            				     			Ext.Msg.alert("提示","请选择一条记录");return;
							            				     		}
							            				     		if(records1.length>1){
							            				     			Ext.Msg.alert("提示","只能编辑一条记录");return;
							            				     		}
							                                    	exportFile("bookNote",records[0].data.billCode,records1[0].data.ID);
							                                    }        
							                                   })
							                                  ]
							                              },grid1,

				   					        ]
				   			};	
				     		var win1 = Ext.create("Ext.window.Window", {
							    title: '服务项维护',
							    width: '80%',
							    height: '80%',
							   resizable: true,
							    modal: true,
							   closable: true,
							   maximizable: true,
							   minimizable: true,
//				 			   buttons:[save1,clear1,close1],
							   items:[needful],
							   buttons: [{
			       		            text: '保存',
			       		            handler: function(){
			       		            	var form = Ext.getCmp('form').getForm();
			       		            	var billType = Ext.getCmp('BILL_TYPE1').getRawValue();//获取提单类型
			       		            	form.submit({
			       		            		params:{
	 		       		            		billCode:encodeURI(form.findField('billCode').value),	
	 		       		            	    billType : billType, 
//	 		       		            		RIVER_BOAT_NAME_ID:encodeURI(form.findField('RIVER_BOAT_NAME').value),
// 			       		            		RIVER_BOAT_NAME:tt,
// 			       		            		BOAT_VOYAGE_NAME:encodeURI(form.findField('BOAT_VOYAGE_NAME').value),
// 			       		            		BOAT_PLAN_SAIL_TIME:encodeURI(Ext.util.Format.date(form.findField("BOAT_PLAN_SAIL_TIME").value,'Y-m-d')),
// 			       		            		MATCH_LOAD_REMARK:encodeURI(form.findField('MATCH_LOAD_REMARK').value),
// 			       		            		CONTAINER_TYPE_NUM:encodeURI(form.findField('CONTAINER_TYPE_NUM').value),
// 			       		            		RIVER_BOAT_NAME_ID:encodeURI(form.findField('RIVER_BOAT_NAME1').valueModels[0].data.BOAT_ID),
// 			       		            		SETTLE_COMPANY:form.findField('RIVER_BOAT_NAME1').valueModels[0].data.SETTLE_COMPANY,
// 			       		            		ID:encodeURI(form.findField('ID').value),
			       		            		
			       		            			
			       		            		},
			       		            		waitTitle : '请稍后...',  
			       		            		waitMsg : '正在保存信息,请稍后...',  
			       		            		url:'../consignHandle/updateBookNote',
					          				success:function(form,action){
					          					Ext.Msg.alert("提示","保存成功");
					          					store.load();
					          					win1.close();
					          				},

					          			});

			       		            }
			       		        },{
			       		            text: '关闭',
			       		            handler: function(){
			       		            	win1.close();
			       		            }
			       		        }]
							});
				   	 		win1.show();   		
			 	}
			});
			var grid = Ext.create('Ext.grid.Panel', {
				renderTo: "output",
				store: store,
				id:'grid',
				height: document.documentElement.clientHeight*0.96,
				stripeRows:true,
				columnLines: true,
				selModel:Ext.create('Ext.selection.CheckboxModel',{mode:"single", allowDeselect: true, showHeaderCheckbox:false}),
				columns: [
					{text: 'ID', dataIndex: 'ID',hidden:true},
					{text: 'TERRITORY_GOODS_SUPPLY', dataIndex: 'TERRITORY_GOODS_SUPPLY',hidden:true},
					{text: 'PRICE_START_TIME', dataIndex: 'PRICE_START_TIME',hidden:true},
					{text: 'PRICE_STOP_TIME', dataIndex: 'PRICE_STOP_TIME',hidden:true},
					{text: 'DESTINATION_COUNTRY', dataIndex: 'DESTINATION_COUNTRY',hidden:true},
					{text: 'RIVER_LOAD', dataIndex: 'RIVER_LOAD',hidden:true},
					{text: 'appointShipRoute', dataIndex: 'appointShipRoute',hidden:true},
					{text: 'riverUnload', dataIndex: 'riverUnload',hidden:true},
					{text: 'riverDelivery', dataIndex: 'riverDelivery',hidden:true},
					{text: 'businessTypeId', dataIndex: 'businessTypeId',hidden:true},
					{text: 'TRANSPORT_CLAUSE', dataIndex: 'TRANSPORT_CLAUSE',hidden:true},
					{text: 'EMPTY_WEIGHT_BOX', dataIndex: 'EMPTY_WEIGHT_BOX',hidden:true},
					{text: 'boxTypeConfirm', dataIndex: 'boxTypeConfirm',hidden:true},
// 					{text: '托单编号', dataIndex: 'billCode', align: 'left', maxWidth: 100 ,locked: true},
// 					{text: '提单号', dataIndex: 'ladingBillCode', maxWidth: 200 ,locked:true},
// 					{text: '箱主', dataIndex: 'containerOwner', maxWidth: 80},
// 					{text: '装运港', dataIndex: 'riverPort', maxWidth: 80},
// 					{text: '预计放箱时间', dataIndex: 'estimateTime', maxWidth: 80, render:convertDate},
// 					{text: '海船装区', dataIndex: 'loadingGoingShips', align: 'left', minWidth: 80},
// 					{text: '卸货港', dataIndex: 'riverUnload', maxWidth: 80},
// 					{text: '交货地', dataIndex: 'riverDelivery', maxWidth: 80},
// 					{text: '业务员', dataIndex: 'salerName', maxWidth: 80},
// 					{text: '接单时间', dataIndex: 'createTime', maxWidth: 80 , render:convertDate},
// 					{text: '货代客服', dataIndex: 'forwarderCustomerService', maxWidth: 80},
// 					{text: '运输条款', dataIndex: 'transportClause', maxWidth: 80},
// 					{text: '箱型箱量', dataIndex: 'boxTypeConfirm', maxWidth: 80},
// 					{text: '中文品名', dataIndex: 'chineseName', maxWidth: 80},
// 					{text: '件数', dataIndex: 'goodsNum', maxWidth: 80},
// 					{text: '包装类别', dataIndex: 'unit', maxWidth: 80},
// 					{text: '货物毛重', dataIndex: 'goodsGrossWeight', maxWidth: 80},
// 					{text: '箱货总重', dataIndex: '', maxWidth: 80},
// 					{text: '总体积', dataIndex: 'volume', maxWidth: 80},
// 					{text: '货物种类', dataIndex: 'goodsType', maxWidth: 80},
// 					{text: '贸易类型', dataIndex: 'tradeType', maxWidth: 80},
// 					{text: '预计江船装船时间', dataIndex: 'estimateRiverBoatTime', maxWidth: 80, render:convertDate},
// 					{text: '海船周次', dataIndex: 'sailingTimes', maxWidth: 80},
// 					{text: '委托单位', dataIndex: 'shipperId', maxWidth: 80},
// 					{text: '托运人', dataIndex: 'shipperName', maxWidth: 80},
// 					{text: '订舱人员', dataIndex: 'bookingClerk', maxWidth: 80},
// 					{text: '订舱备注', dataIndex: 'bookingOperationNotes', maxWidth: 80}
					{text: '托单编号', dataIndex: 'billCode', align: 'left', maxWidth: 500 ,locked: true},
					{text: '提单号', dataIndex: 'ladingBillCode', maxWidth: 500 ,locked:true},
					{text: '货主', dataIndex: 'consignorName', maxWidth: 200},
					{text: '主提单', dataIndex: 'IS_MAIN_LADING_BILL', maxWidth: 200},
					{text: '托运人自编号', dataIndex: 'SHIPPER_NUM', maxWidth: 200},
					{text: '业务类型', dataIndex: 'BUSINESS_TYPE', maxWidth: 200},
					{text: '订舱类型', dataIndex: 'BILL_FLOW', maxWidth: 200},
					{text: '订舱价格', dataIndex: 'BOAT_COMPANY_BOOK_PRICE', maxWidth: 200},
					{text: '航线', dataIndex: 'BOAT_VOYAGE_NAME', maxWidth: 200},
					{text: '价格开始时间', dataIndex: 'PRICE_START_TIME', maxWidth: 200},
					{text: '价格结束时间', dataIndex: 'PRICE_STOP_TIME', maxWidth: 200},
					{text: '预计海船期', dataIndex: 'APPOINT_ESTIMATE_SHIP_TIME', maxWidth: 200},
					{text: '提单类型', dataIndex: 'BILL_TYPE', maxWidth: 200},
					{text: '发票号', dataIndex: 'INVOICE_NUM', maxWidth: 200},
					{text: '船代', dataIndex: '', maxWidth: 200},
					{text: '支线船公司', dataIndex: 'SUB_SUPPLIER', maxWidth: 200},
					{text: '预配箱主', dataIndex: 'RESERVE_MATCH_BOX_OWNER', maxWidth: 200},
					{text: '货物种类', dataIndex: 'GOODS_TYPE', maxWidth: 200},
					{text: '箱型确定', dataIndex: 'BOX_TYPE_CONFIRM', maxWidth: 200},
					{text: '20', dataIndex: 'TWENTY_GP', maxWidth: 200},
					{text: '40', dataIndex: 'FORTY_GP', maxWidth: 200},
					{text: '40H', dataIndex: 'FORTY', maxWidth: 200},
					{text: '45', dataIndex: 'FORTY_FIVE', maxWidth: 200},
					{text: '特种箱', dataIndex: 'SPECIAL_CONTAINER', maxWidth: 200},
					{text: 'TEU', dataIndex: 'TEU', maxWidth: 200},
					{text: '报关方式', dataIndex: 'CUS_MOD', maxWidth: 200},
					{text: '报关行', dataIndex: 'CUS_BRO', maxWidth: 200},
					{text: '报关资料交报关时间', dataIndex: '', maxWidth: 200},
					{text: '报关单号', dataIndex: '', maxWidth: 200},
					{text: '报关放行时间', dataIndex: '', maxWidth: 200},
					{text: '江船装区', dataIndex: 'RIVER_LOAD', maxWidth: 200},
					{text: '江船卸区', dataIndex: 'RIVER_UNLOAD', maxWidth: 200},
					{text: '海船装区', dataIndex: 'SEA_LOAD', maxWidth: 200},
					{text: '订舱卸货港', dataIndex: 'PORT', maxWidth: 200},
					{text: '订舱交货地', dataIndex: 'END_PORT', maxWidth: 200},
					{text: '订舱海船期', dataIndex: '', maxWidth: 200},
					{text: '订舱海船航线', dataIndex: '', maxWidth: 200},
					{text: '卸货港', dataIndex: '', maxWidth: 200},
					{text: '交货地', dataIndex: 'RIVER_DELIVERY', maxWidth: 200},
					{text: '江船名', dataIndex: 'BOAT_NAME', maxWidth: 200},
					{text: '江船航次', dataIndex: 'BOAT_VOYAGE_NAME', maxWidth: 200},
					{text: '江船ETD', dataIndex: 'BOAT_ETD', maxWidth: 200},
					{text: '江船ETA', dataIndex: 'BOAT_ETA', maxWidth: 200},
					{text: '江船ATD', dataIndex: 'BOAT_ATD', maxWidth: 200},
					{text: '签单船名', dataIndex: '', maxWidth: 200},
					{text: '签单航次', dataIndex: '', maxWidth: 200},
					{text: '签单ETD', dataIndex: '', maxWidth: 200},
					{text: '签单ETA', dataIndex: '', maxWidth: 200},
					{text: '实际海船名', dataIndex: 'SHIP_NAME', maxWidth: 200},
					{text: '实际海船航次', dataIndex: 'SHIP_VOYAGE_NAME', maxWidth: 200},
					{text: '实际海船ATD', dataIndex: 'SHIP_ATD', maxWidth: 200},
					{text: '实际海船ATA', dataIndex: 'SHIP_ATA', maxWidth: 200},
					{text: '已上海船时间', dataIndex: '', maxWidth: 200},
					{text: '客户服务', dataIndex: '', maxWidth: 200},
					{text: '销售', dataIndex: 'SALER_NAME', maxWidth: 200},
					{text: '接收委托时间', dataIndex: 'ENTRUST_TIME', maxWidth: 200},
					{text: '是否套约', dataIndex: 'ISSET_ABOUT', maxWidth: 200},
					{text: 'MSC提单号', dataIndex: 'MSC_LADING_BILL', maxWidth: 200},
					{text: '运价审核', dataIndex: 'FREIGHT_EXAMINE', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '订舱受理', dataIndex: 'BOOKING_CARGO_ACCEPTANCE', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '海船公司放箱', dataIndex: 'SHIP_COMPANY_PUT_BOX', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '码头放箱', dataIndex: 'WHARF_PUT_BOX', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '客服放箱', dataIndex: 'CUSTOMER_PUT_BOX', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '费用录入完成', dataIndex: 'IS_FEE_FINISH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '拖车计划', dataIndex: 'TRAILER_PLAN', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '拖车完成', dataIndex: 'TRAILER_FINISH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '保险申报单', dataIndex: 'INSURANCE_APPLY_BILL', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '港装装箱', dataIndex: 'HARBOUR_PRETEND_BOX', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '装箱完成', dataIndex: 'PRETEND_BOX_FINISH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '报关计划', dataIndex: 'CUSTOMS_PLAN', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '报关完成', dataIndex: 'CUSTOMS_FINISH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '熏蒸完成', dataIndex: 'FUMIGATION_FINISH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '申请配载', dataIndex: 'APPLY_MATCH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '江船配载', dataIndex: 'BOAT_MATCH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '运抵成功', dataIndex: 'TRANSPORT_SUCCESS', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '分箱数据提交', dataIndex: 'PRETEND_BOX_DATA_SUBMIT', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: 'VGM确认', dataIndex: 'VGM_CONFIRM', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '提单确认', dataIndex: 'LADING_BILL_CONFIRM', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '提单签发', dataIndex: 'LADING_BILL_ISSUE', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '海船预配', dataIndex: 'SHIP_PRE_MATCH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '关封制作', dataIndex: 'SEAL_PRE_MATCH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '预配舱单', dataIndex: 'PRE_MATCH_CABIN_BILL', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '中转报关', dataIndex: 'TRANSFER_CUSTOMS', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '是否到港', dataIndex: 'IS_TO_PORT', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '海船实配', dataIndex: 'SHIP_WITH', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '封账', dataIndex: 'SEAL_ACCOUNT', maxWidth: 200,resizable:true , renderer:statusCheckBox},
					{text: '申请开票', dataIndex: 'APPLY_BILLING', maxWidth: 200,resizable:true , renderer:statusCheckBox},
				],
				bbar: [{
					xtype: 'pagingtoolbar',
					store: store,
					displayMsg: '显示 {0} - {1} 条，共计 {2} 条',
					emptyMsg: "没有数据",
					beforePageText: "当前页",
					afterPageText: "共{0}页",
					displayInfo: true
				}],
				listeners: {
					'itemclick': function (view, record, item, index, e) {
//                    Ext.MessageBox.alert("标题", record.data.cataId);
					}
				},
				tbar: [tbtn1,
					{text: '费用修改', icon: '../plugins/websocketInstantMsg/ext4/shared/icons/fam/table_refresh.png', handler: function (){
						 var records = grid.getSelectionModel().getSelection();
			        	 if(records.length==0){
				       			Ext.Msg.alert("提示","请选择一条记录");return;
				       		}
				       		if(records.length>1){
				       			Ext.Msg.alert("提示","只能选择一条记录");return;
				       		}
				       		var billCode = records[0].data.billCode;
				       		var ladingBillCode = records[0].data.ladingBillCode;
				       		var shipperName = records[0].data.shipperName;
						document.location.href="../bookingCargo/forward?url=/business/consignhandle/cost"+"&billCode="+billCode+"&ladingBillCode="+ladingBillCode+"&shipperName="+encodeURI(shipperName);
					} },tbtn3,tbtn4]
			});

			function convertDate(val) {
				return Ext.util.Format.date(new Date(val), 'Y-m-d');
			}

			var tradeTypeStore = Ext.create('Ext.data.Store', {
				fields: ['id', 'name'],
				data : [
					{"id":"", "name":"全部"},
					{"id":"AK", "name":"内贸"},
					{"id":"AZ", "name":"外贸"}
				]
			});
			var maoyi = Ext.create('Ext.data.Store', {
				fields: ['id', 'name'],
				data : [
					{"id":"", "name":"全部"},
					{"id":"1", "name":"已放箱"},
					{"id":"2", "name":"未放箱"}
				]
			});
			var store521 = Ext.create('Ext.data.Store', {
				fields: ["OWNER_CODE"],
				pageSize: 30,  //页容量5条数据
				   remoteSort: false,
			        remoteFilter: true,
				//是否在服务端排序 （true的话，在客户端就不能排序）
				proxy: {
					type: 'ajax',
					url: '../consignHandle/findInfo',
					reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
						type: 'json', //返回数据类型为json格式
						  root: 'rowsaa',  //数据
			                totalProperty: 'totaltt' //数据总条数
			                }
				},
				autoLoad: true
			});
			
			function tt(){
				Ext.getCmp('grid1').show();
			
			}
			var c1 = Ext.create('Ext.container.Container', {
				layout: 'column',
				defaults: { labelAlign: 'left', labelWidth: 60 },
				items: [
					{xtype: 'textfield', name: 'startDate1',id:'startDate1', columnWidth: 1/5,padding: '5px',fieldLabel: '托单编号'},
					{xtype: 'textfield', name: 'startDate2', id:'startDate2',columnWidth:  1/5,padding: '5px', fieldLabel: '提单号'},
					/* {xtype: 'textfield', name: 'startDate3',id:'startDate3',columnWidth: 1/5,padding: '5px',fieldLabel: '箱主'},
					*/
					{xtype: 'combobox',  name: 'startDate3', id:'startDate3',columnWidth:  1/5,padding: '5px', fieldLabel: '箱主',editable: false,valueField:'OWNER_CODE',displayField:'OWNER_CODE',store:store521,},
					{xtype: 'textfield', name: 'startDate4',id:'startDate4',columnWidth:  1/5,padding: '5px',fieldLabel: '订舱人员'},
					{xtype: 'combobox',  name: 'startDate5', id:'startDate5',columnWidth:  1/5,padding: '5px', fieldLabel: '放箱状态',editable: false,valueField: 'id',displayField: 'name',store:maoyi,}
				]
			});
			var c2 = Ext.create('Ext.container.Container', {
				layout: 'column',
//				defaults: { labelAlign: 'left', labelWidth: 60 },
				items: [
					{xtype: 'textfield', name: 'startDate6',id:'startDate6',columnWidth: 1/6,padding: '5px', fieldLabel: '货代客服'},
/* 					{xtype: 'datefield', name: 'startDate7',id:'startDate7',columnWidth:  1/6,padding: '5px',fieldLabel: '放箱时间'},
					{xtype: 'datefield', name: 'startDate8',id:'startDate8',columnWidth:  1/6,padding: '5px',labelSeparator:'',fieldLabel: '--'}, */
					{xtype: 'datefield', name: 'startDate9',id:'startDate9',columnWidth:  1/6,padding: '5px',fieldLabel: '江船期'},
					{xtype: 'datefield', name: 'startDate10',id:'startDate10',columnWidth:  1/6,padding: '5px',labelSeparator:'',fieldLabel: '--'},
					{xtype: 'combobox',  name: 'startDate11',id:'startDate11',editable: false,valueField: 'id',displayField: 'name', queryMode: 'local',store:tradeTypeStore,  columnWidth:  1/6,padding: '5px', fieldLabel: '贸易类型'}
				]
			});
			var bs = Ext.create('Ext.container.Container', {
				layout: 'column',
				items: [
					{layout : 'column',baseCls : 'my-panel-no-border', columnWidth: 2/5,   padding: '10px'},
					{layout : 'column',baseCls : 'my-panel-no-border',columnWidth: 1/5,  padding: '10px',  items: [
						{ style: {marginRight:'10px'}, xtype: "button",minWidth:70,icon:'../plugins/websocketInstantMsg/ext4/shared/icons/fam/add.png', text: "查  询",
							handler : function() {
								//alert("00")
								var billCode = Ext.getCmp('startDate1').getValue();//托单编号
								//alert(billCode)
								var ladingBillCode = Ext.getCmp('startDate2').getValue(); //提单编号
						      // alert(ladingBillCode)
						 		var containerOwner = Ext.getCmp('startDate3').getValue();//箱主
								//alert(containerOwner)
	                            var riverUnload=Ext.getCmp('startDate4').getValue();//订舱人员
	                           // alert(RIVER_PORT)
	                            //var riverDelivery=Ext.getCmp('startDate5').getRawValue();//放箱状态
	                            // alert(BOAT_NAME)
	                             var riverDelivery=Ext.getCmp('startDate5').getValue();//放箱状态
	                            var forwarderCustomerService=Ext.getCmp('startDate6').getValue();//贷款客服
		                           // alert(FORWARDER_CUSTOMER_SERVICE)
	                       
	                          /*   var BOAT_VOYAGE_NAME=Ext.getCmp('startDate6').getValue();//江船航次
	                           // alert(BOAT_VOYAGE_NAME)
	                            var CONTAINERNO=Ext.getCmp('startDate7').getValue();//箱号
	                           // alert(CONTAINERNO) */
	                       
	                            var startDate=Ext.getCmp('startDate9').getValue();//江船开始
	                            //alert(SHIPPER_NUM)
	                             var endDate=Ext.getCmp('startDate10').getValue();//江船结束
	                             var businessType=Ext.getCmp('startDate11').getValue();//贸易类型
								var store = Ext.getCmp('grid').getStore();						
								store.on('beforeload', function(store, options) {
									var new_params = {
											billCode : billCode,
											ladingBillCode : ladingBillCode,
											containerOwner : containerOwner,
											riverUnload : riverUnload,
											riverDelivery :riverDelivery,
											startDate : startDate,
											endDate : endDate,
											forwarderCustomerService : forwarderCustomerService,
											businessType : businessType
									};
									Ext.apply(store.proxy.extraParams, new_params);
								});
								store.load();
							}}
					]},
					{layout : 'column',baseCls : 'my-panel-no-border', columnWidth: 2/5,  padding: '10px'}
				]
			});

			var selForm = Ext.create('Ext.form.Panel', {
				title:'托单信息列表',
				name: 'selForm',
				renderTo: "selForm",
				height:140,
				collapsible:true,
				collapsed :true,
				bodyStyle: {
					padding: '5px',
					border: 1
				},
				fieldDefaults: {
					labelAlign: 'left'
				},
				items: [c1, c2,bs]
			});


		});
		function exportFile(type,billCode,ID){
//		     if(Ext.getCmp('grid').getSelectionModel().getSelection().length == 0){
//		         Ext.MessageBox.alert("提示", "请选择托单记录！");
//		         return;
//		     }
// 		     var billCode = Ext.getCmp('grid').getSelectionModel().getSelection()[0].get("billCode");
		    document.location.href="../common/export/exportExcel?exportType="+type+"&billCode="+billCode+"&ID="+ID;
		}
		function statusCheckBox(value) {
		    return '<input disabled="disabled" type="checkbox"' + (value == "1" ? " checked" : "") + '/>';
		}
		
	</script>

</html>